#include <future>
#include <iostream>

int find_result_to_add()
{
    std::this_thread::sleep_for(std::chrono::seconds(1));
	std::cout << "1 World" << std::endl;
    std::this_thread::sleep_for(std::chrono::seconds(1));
	std::cout << "2 World" << std::endl;
    std::this_thread::sleep_for(std::chrono::seconds(1));
	std::cout << "3 World" << std::endl;
    std::this_thread::sleep_for(std::chrono::seconds(1));
	return 1 + 1;
}

void do_other_things() 
{
    std::this_thread::sleep_for(std::chrono::seconds(1));
	std::cout << "1 1" << std::endl;
}

int main()
{
	std::future<int> result = std::async(find_result_to_add);
	do_other_things();
	std::cout << result.get() << std::endl;
	do_other_things();
	return 0;
}
